unit OrderValidator;

interface

uses
  Order;

type

  IOrderValidator = interface
  ['{8DDEF76E-B36A-4301-9FE4-0B6789B37A2F}']
    function ValidateOrder(aOrder: TOrder): Boolean;
  end;

  TOrderValidator = class(TInterfacedObject, IOrderValidator)
    function ValidateOrder(aOrder: TOrder): Boolean; virtual;
  end;

implementation

{ TOrderValidator }

uses Spring.XE.Utils;

function TOrderValidator.ValidateOrder(aOrder: TOrder): Boolean;
begin
  Result := aOrder <> nil;

  WriteLn('Validating Order....');

end;

initialization
  TSpringXEUtils.TryRegisterClass(TOrderValidator);

end.
